package com.my.cloud.controller;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/3/14 11:35
 */

import com.my.cloud.resp.ResultData;
import com.my.cloud.service.AccountService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/account")
public class AccountController {
    
    @Resource
    private AccountService accountService;
    
    @PostMapping("/decrease")
    public ResultData decrease(@RequestParam("userId") Long userId, @RequestParam("money") Long money){
        accountService.decrease(userId, money);
        return ResultData.success("账户扣减成功");
    }
    
}
